package com.wj.rpsm.user.service.impl;

import com.wj.rpsm.user.mapper.CommentMapper;
import com.wj.rpsm.user.pojo.Comment;
import com.wj.rpsm.user.pojo.vo.CommentVo;
import com.wj.rpsm.user.pojo.vo.ForumVo;
import com.wj.rpsm.user.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author WeiJin
 * @version 1.0
 */
@Service
public class CommentServiceImpl implements CommentService {

   @Autowired
   private CommentMapper commentMapper;

    @Override
    public List<CommentVo> queryCommentByMessageId(Integer messageId) {

        return commentMapper.getParentComment(messageId);
    }

    @Override
    public Integer addComment(Comment comment) {
        return commentMapper.addComment(comment);
    }

    @Override
    public Integer updateMessageLike(Integer commentId) {
        return commentMapper.updateCommentLike(commentId);
    }

    @Override
    public Integer updateMessageUnlike(Integer commentId) {
        return commentMapper.updateCommentUnlike(commentId);
    }
}
